Transport
agents allow you to install custom software on a Hub or Edge Transport
server role in Exchange Server 2010. Based on an action when a message
flows through the transport pipeline, the software then can process
messages. The backscatter agent, is an example of a transport agent.
Note: Transport
agents have full access to all e-mail messages that they encounter.
There are no restrictions on a transport agent's behavior. Transport
agents that are unstable or contain security flaws may affect the
stability and security of Exchange. Do not install transport agents
that haven't been fully tested in a test environment!
1. Default Transport Agents
Exchange Server 2010 includes several transport agents that enable it to provide additional features such as rights management service (RMS) or journaling. Table 1 lists default transport agents sorted by Hub Transport and Edge Transport server roles.
Table 1. Default Transport Agents
HUB TRANSPORT AGENTS | EDGE TRANSPORT AGENTS |
---|
Transport Rule agent | Connection Filtering agent |
RMS Encryption agent | Address Rewriting Inbound agent |
RMS Decryption agent | Edge Rule agent |
Prelicensing agent | Content Filter agent |
Journaling agent | Sender ID agent |
Journal Report Decryption agent | Sender Filter agent |
Text Messaging Routing agent from Text Messaging Delivery Agent Connector | Recipient Filter agent |
| Protocol Analysis agent |
| Attachment Filtering agent |
| Address Rewriting Outbound agent |
You can get a list of all transport agents currently configured on an Exchange Transport server by running the Get-TransportAgent
cmdlet. For a list of Transport Agents that have been used to process
messages since the last time the transport service was restarted, use
the Get-TransportPipeline cmdlet as shown in Figure 1.
2. Events That Trigger Transport Agents
Exchange 2010 Transport
agents use SMTP events to trigger the agent when a message moves
through the transport pipeline. Three areas can trigger events: SMTP Receive events, Categorizer events, and Connection Manager events.
Even though all
events available are listed in the following subsections, this chapter
does not explain in detail how to develop a transport agent, but merely
provides an overview of what you can do using Exchange 2010. More
information about Transport Agents can be found at http://technet.microsoft.com/en-us/library/bb125012.aspx.
2.1. SMTP Receive Events
SMTP Receive events are triggered whenever an SMTP connection is made or an SMTP command is sent, as listed in Table 2. Using SMTP Receive events you can interact with the system at almost every stage of an SMTP communication.
Table 2. SMTP Receive Events Overview
EVENT | DESCRIPTION |
---|
OnConnect | This event is triggered upon initial connection from a remote SMTP host. |
OnEhloCommand | This event is triggered when the EHLO SMTP verb is issued by the remote SMTP host. |
OnHeloCommand | This event is triggered when the HELO SMTP verb is issued by the remote SMTP host. |
OnAuthCommand | This event is triggered when the AUTH SMTP verb is issued by the remote SMTP host. |
OnEndOfAuthentication | This event is triggered when the remote SMTP host has completed authentication. |
OnMailCommand | This event is triggered when the MAIL FROM SMTP verb is issued by the remote SMTP host. |
OnRcptToCommand | This event is triggered when the RCPT TO SMTP verb is issued by the remote SMTP host. |
OnDataCommand | This event is triggered when the DATA SMTP verb is issued by the remote SMTP host. |
OnEndOfHeaders | This event is triggered when the remote SMTP host as completed submitting the e-mail message headers. |
OnEndOfData | This event is triggered when the remote SMTP host issues <CRLF>.<CRLF>, which indicates the end of data. |
OnHelpCommand | This event is triggered when the HELP SMTP verb is issued by the remote SMTP host. This event can occur at any time after the OnConnect SMTP event and before the OnDisconnect SMTP event. |
OnNoopCommand | This event is triggered when the NOOP SMTP verb is issued by the remote SMTP host. This event can occur at any time after the OnConnect SMTP event and before the OnDisconnect SMTP event. |
OnReject | This
event is triggered when the receiving SMTP host issues a temporary or
permanent delivery status notification (DSN) code to the sending SMTP
host. This event can occur at any time after the OnConnect SMTP event and before the OnDisconnect SMTP event. |
OnRsetCommand | This event is triggered when the RSET SMTP verb is issued by the sending SMTP host. This event can occur at any time after the OnConnect SMTP event and before the OnDisconnect SMTP event. |
OnDisconnect | This event is triggered upon disconnection of the SMTP conversation by either a receiving or sending SMTP host. |
2.2. Categorizer Events
The Categorizer events are triggered when a message enters, is processed by, or leaves the categorizer, as listed in Table 3.
Table 3. Categorizer Events Overview
EVENT | DESCRIPTION |
---|
OnSubmittedMessage | This
event is triggered upon submission of a message into the Submission
queues on the receiving SMTP host. All messages encounter this event
whether they arrived via SMTP submission, MAPI submission, or the
Pickup or Replay directories. |
OnResolvedMessage | This
event is triggered after all the recipients have been resolved but
before the next hop has been determined for each recipient. The OnResolvedMessage routing event enables subsequent events to override the default routing behavior by using the per-recipient SetRoutingOverride method. |
OnRoutedMessage | This
event is triggered after messages have been categorized, distribution
lists have been expanded, and recipients have been resolved. |
OnCategorizedMessage | This event is triggered when the Categorizer completes processing the message. |
2.3. Connection Manager Events
Connection manager events are only available to delivery agents such as the Text Messaging Routing agent from Text
Messaging Delivery Agent Connector. As mentioned previously in this
chapter, delivery agents should succeed Foreign Connectors because they
are more flexible. Table 4 provides an overview of the events raised by the connection manager component.
Table 4. Connection Manager Component Events Overview
EVENT | DESCRIPTION |
---|
OnOpenConnection | This
event is raised when there are messages in the queue to be delivered to
the foreign system. It notifies the delivery agent to initiate a
connection to the foreign system. |
OnDeliverMailItem | This event notifies the delivery agent to retrieve the next item from the queue. |
OnCloseConnection | This
event is raised when there are no more messages in the queue to be
delivered to the foreign system. It notifies the delivery agent to
close the connection to the foreign system. |